﻿using System;
using UnityEngine;

namespace Utility
{
	// Token: 0x0200040B RID: 1035
	public static class MaterialUtility
	{
		// Token: 0x060019E0 RID: 6624 RVA: 0x000A6340 File Offset: 0x000A4540
		public static void SwapMaterials(Renderer rend, int no, Material mat)
		{
			Material[] materials = rend.materials;
			materials[no] = mat;
			rend.materials = materials;
		}

		// Token: 0x060019E1 RID: 6625 RVA: 0x000A6360 File Offset: 0x000A4560
		public static void SwapSharedMaterials(Renderer rend, int no, Material mat)
		{
			Material[] sharedMaterials = rend.sharedMaterials;
			sharedMaterials[no] = mat;
			rend.sharedMaterials = sharedMaterials;
		}

		// Token: 0x060019E2 RID: 6626 RVA: 0x000A6380 File Offset: 0x000A4580
		public static void AddSharedMaterials(Renderer rend, Material addMat)
		{
			Material[] sharedMaterials = rend.sharedMaterials;
			Material[] array = new Material[sharedMaterials.Length + 1];
			sharedMaterials.CopyTo(array, 0);
			int num = array.Length - 1;
			array[num] = addMat;
			rend.sharedMaterials = array;
		}
	}
}
